import { Form, Root, Textarea } from 'native-base';
import React from 'react';
import { ScrollView, Text, View } from 'react-native';
import DateTimePicker from "react-native-modal-datetime-picker";
import { NavigationEvents } from 'react-navigation';
export default function tpl(a: (action: string, ...args: unknown[]) => ((...args: unknown[]) => void), s: (...class_name: string[]) => {}, d: (d: string) => string | unknown[] | boolean | number) {
	const select = d("res") as string;
	const qjsy = d('qjsy') as string;
	const time_length = d("time_length") as string;
	const submit_status = d("submit_status") as boolean;
	const isshow = d('isDateTimePickerVisible1') as boolean;
	const ishow = d('isDateTimePickerVisible2') as boolean;
	const time1 = d("time1") as string;
	const time2 = d("time2") as string;
	return (<View style={{ backgroundColor: '#F4F4F4', height: '100%' }}>
		<ScrollView style={{ marginBottom: 80 }}>
			<Root>
				<View>
					<NavigationEvents onWillFocus={a('a001')}>

					</NavigationEvents>
					<View style={s('View1', 'mt20')}>
						<Text style={s('text1')} >
							<Text style={s('coR')}>*</Text>请假类型</Text>
						<Text onPress={a('a002')} style={s('text2')}>{select || '请选择'}<Text style={{ paddingLeft: 20 }}>></Text></Text>
					</View>

					<View style={{ marginTop: 10 }}>
						<Text style={s('text3')}>请假时间</Text>
					</View>
					<View style={s('View1')}>
						<Text style={s('text1')}>
							<Text style={s('coR')}>*</Text>开始时间
					</Text>
						<Text style={s('text2')} onPress={a('a003')}>
							{time1 || "请选择"}<Text style={{ paddingLeft: 20 }}>></Text>
							<DateTimePicker
								is24Hour={false}
								datePickerModeAndroid="spinner"
								timePickerModeAndroid="spinner"
								mode="datetime"
								isVisible={isshow}
								onConfirm={a('a008')}
								onCancel={a('a009')}
							/>
						</Text>
					</View>
					<View style={s('View1')}>
						<Text style={s('text1')} ><Text style={s('coR')}>*</Text>结束时间
					</Text>
						<Text style={s('text2')} onPress={a('a004')}>
							{time2 || "请选择"}<Text style={{ paddingLeft: 20 }}>></Text>
							<DateTimePicker
								is24Hour={false}
								datePickerModeAndroid="spinner"
								timePickerModeAndroid="spinner"
								mode="datetime"
								isVisible={ishow}
								onConfirm={a('a011')}
								onCancel={a('a012')}
							/>
						</Text>
					</View>
					<View style={s('View1')}>
						<Text style={s('text1')} ><Text style={s('coR')}>*</Text>时长(天)</Text>
						{/* <TextInput placeholder='请输入时长'>
					</TextInput> */}
						<Text>{time_length || "时长"}</Text>
					</View>
					<View style={s('mt20', 'View3')}>
						<Text style={s('text4')} ><Text style={s('coR')}>*</Text>请假事由</Text>
						<Form >
							<Textarea onChangeText={a('a006')} value={qjsy} rowSpan={5} placeholder="请输入请假事由" />
						</Form>
					</View>
				</View>
			</Root>
		</ScrollView >
		<View style={s('buttom')}>
			<View style={s('buttom1')}>
				<Text style={s(submit_status ? 'btn1' : "btn2")} onPress={a('a007')}>提交</Text>
			</View>
		</View>

	</View>
	);
}
